<template>
	<view>
		<view v-if="hide==0">
			<view class="informationwhite" >
				<view class="informationwhite-input1">
					<view>意见反馈：</view>
					<textarea  placeholder="请输入建议" auto-height maxlength="300"  v-model="body" ></textarea>
					
				</view>
				
			</view>
			<view class="button" @click="formSubmit">提交</view>
		</view>
		
		<view class="chenggong" v-if="hide == 1">
			<image  src="../../static/questions/dui.png"></image>
			<view class="tishi">提交成功！<br>您的反馈是我们最大的动力。</view>
			
			<view class="button" @click="returnClick">返回</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				body: '',
				hide  : 0
			};
		},
		methods:{
			formSubmit(){
				let that = this;
				if(!that.body){
					uni.showToast({
						title: '意见反馈不能为空',
						icon: "none"
					});return;
				}
				that.$api.setFeedback({'body':that.body}).then(res=>{
					if(res.code  == 1){
						that.hide  = 1;
					}else{
						uni.showToast({
							title: res.msg,
							icon: "none"
						});return;
					}
				})
				
			},
			returnClick(){
				uni.switchTab({
					url : '/pages/my/my'
				})
			}
		}
	}
</script>

<style lang="less">
	.informationwhite {
		background-color: #fff;
		margin-top: 20rpx;
		
		.informationwhite-input1 {
			// display: flex;
			width: 690rpx;
			margin: auto;
			padding-top: 30rpx;
			padding-bottom: 30rpx;
			font-size: 36rpx;
			// border-bottom: 2rpx solid #e3e3e3;
			view {
				width: 210rpx;
				
			}
			textarea {
				margin-top: 20rpx;
				padding: 10rpx;
				width: 690rpx;
				min-height: 300rpx;
				border: 2rpx solid #e3e3e3;
				
			}
		}
		.informationwhite-input:last-child {
			border: none;
		}
	}
	.button {
		background-color: #3eb8ff;
		width: 690rpx;
		line-height: 100rpx;
		margin: auto;
		margin-top: 40rpx;
		border-radius: 60rpx;
		color: #fff;
		font-size: 34rpx;
		text-align: center;
	}
	.chenggong {
		image {
			width: 300rpx;
			height: 300rpx;
			display: block;
			margin: auto;
			margin-top: 10%;
		}
		.tishi {
			text-align: center;
			color: #3eb8ff;
			font-size: 38rpx;
		}
	}
</style>
